import request from '@/utils/request'

// 获取角色列表
export function getRole(params) {
  return request({
    url: '/auth/role',
    params
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/auth/role',
    method: 'POST',
    data
  })
}

// 回显
export function viewRole(id) {
  return request({
    url: `/auth/role/${id}`
  })
}

// 编辑
export function editRole(data) {
  return request({
    url: `/auth/role/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除
export function removeRole(id) {
  return request({
    url: `/auth/role/${id}`,
    method: 'DELETE'
  })
}
